package com.qf.util;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/**
 * 2019/11/13
 * Administrator
 * spring_anno_aop_1113
 * 面向对象面向君  不负代码不负卿
 */
@Component
@Aspect
public class AopUtil {

    @Pointcut("execution(* com.qf.dao.*.*(..))")
    public void abc(){}


    @Before("abc()")
    public void before(){
        System.out.println("前置增强");
    }

    @AfterReturning("abc()")
    public void afterreturn(){
        System.out.println("后置增强");
    }

    @After("abc()")
    public void after(){
        System.out.println("最终增强");
    }

    @AfterThrowing("abc()")
    public void throwing(){
        System.out.println("异常增强");
    }
   @Around("abc()")
   public void around(ProceedingJoinPoint joinPoint) throws  Throwable{
       System.out.println("环绕开始");
        joinPoint.proceed();
       System.out.println("环绕结束");
   }






}
